<?php
ini_set('soap.wsdl_cache_enabled', '0');
require_once('../class/config.php');
$soapClient = new Client_NO2_T2NO2ApiService();

//var_dump($soapClient->__getFunctions());

$tmpDate = new DateTime();
$client = new Client_NO2_Client('T2NO2.13.14', 'client name x');
$oldES = new Client_NO2_ES('T2ES1', 'xxx1');
//$oldES = null;
$newES = new Client_NO2_ES('T2ES2', 'xxx2');
$changeDate = $tmpDate->format(DATE_ATOM);
$supplierChange = new Client_NO2_SupplierChange($client, $oldES, $newES, $changeDate);

$qualitySeriesRequest = new Client_NO2_QualitySeries('T2RK2', $changeDate, 123);

$start = $changeDate;
$end = $changeDate;
$period = new Client_NO2_TimePeriod($start, $end);
$amount = 100.10;
$loadProfileRequest = new Client_NO2_LoadProfile($oldES, $period, $amount);

try {
    print_r($soapClient->notifyOfClientESChange($supplierChange));
    //print_r($soapClient->qualitySeries($qualitySeriesRequest));
    //print_r($soapClient->loadProfile($loadProfileRequest));
} catch (SoapFault $exception) {
    print_r($exception);
}

echo date('H:i:s');
